﻿using System;
using Quartz;

namespace OigSync.Domain.Service.Job.Impl
{
    public class JobDetailServiceImpl
    {
        public IJobDetail Create(JobDetailInfo info)
        {
            if (info is GetOrderJobDetailInfo)
                return CreateGetOrderJob(info as GetOrderJobDetailInfo);
            return null;
        }

        private IJobDetail CreateGetOrderJob(GetOrderJobDetailInfo info)
        {
            String name = Guid.NewGuid().ToString();
            return JobBuilder.Create<GetOrderJob>().WithIdentity(name, "GetOrder").Build();
        }
    }
}